package coreentity

import (
	"core/coreinfo"
	"core/corestruct"
	"core/coreutil"
	"reflect"
)

type HtDept struct {
	Id int64 `json:"id,string"                         gorm:"column:id;primaryKey;comment:主键;autoIncrement:false;"`

	Name string `json:"name"         validate:"required,max=100"gorm:"column:name;size:100;DEFAULT:'';not null;comment:机构名称;"`

	Pid      int64 `json:"pid,string"                       gorm:"column:pid;DEFAULT:0;not null;comment:父编号;memo:1000研发后台 2000 单位平台 3000主管平台  4000厂家平台;"`
	RootId   int64 `json:"rootId,string"                    gorm:"column:root_id;DEFAULT:0;not null;comment:机构顶级编号;"`
	HtplatId int64 `json:"htplatId,string"                    gorm:"column:htplat_id;DEFAULT:0;not null;comment:平台编号;"`

	HtareaId   int64   `json:"htareaId,string"                    gorm:"column:htarea_id;DEFAULT:0;not null;comment:区域编号;"`
	Address    string  `json:"address"      validate:"max=100"  gorm:"column:address;size:100;DEFAULT:'';not null;comment:地址;"`
	Dutyperson string  `json:"dutyperson"   validate:"max=50"   gorm:"column:dutyperson;size:50;DEFAULT:'';not null;comment:联系人;"`
	Tel        string  `json:"tel"          validate:"max=40"   gorm:"column:tel;size:40;DEFAULT:'';not null;comment:联系电话;"`
	Memo       string  `json:"memo"                             gorm:"column:memo;size:2000;DEFAULT:'';not null;comment:备注;"`
	Url        string  `json:"url"                              gorm:"column:url;DEFAULT:'';not null;comment:照片;"`
	State      string  `json:"state"        validate:"max=10"   gorm:"column:state;size:10;DEFAULT:'';not null;comment:状态;memo:启用、停用;"`
	Lng        float64 `json:"lng"                              gorm:"column:lng;not null;comment:经度;"`
	Lat        float64 `json:"lat"                              gorm:"column:lat;not null;comment:纬度;"`

	CrtDt   corestruct.MyTime    `json:"crtDt"                            gorm:"column:crt_dt;not null;comment:创建日期;"`
	CrtUid  int64                `json:"crtUid,string"                    gorm:"column:crt_uid;DEFAULT:0;not null;comment:创建人编号;"`
	CrtDid  int64                `json:"crtDid,string"                    gorm:"column:crt_did;DEFAULT:0;not null;comment:机构编号;"`
	EdtDt   corestruct.MyTime    `json:"edtDt"                            gorm:"column:edt_dt;not null;comment:修改日期;"`
	EdtUid  int64                `json:"edtUid,string"                    gorm:"column:edt_uid;DEFAULT:0;not null;comment:修改人编号;"`
	Gid     string               `json:"gid"                              gorm:"column:gid;DEFAULT:'';type:char(36);not null;comment:Gid;"`
	Deleted corestruct.DeletedAt `json:"deleted"                          gorm:"column:deleted;DEFAULT:0;type:tinyint(1);not null;comment:删除标志;"`
}

func (p *HtDept) TableName() string {
	return "HtDept"
}
func HtDeptInit() {
	var mcls = &HtDept{}
	var m = &corestruct.MyClass{
		Name:     "机构表",
		Ename:    "",
		FullName: "",
		Memo:     "",
		Fileds:   nil,
		PrjName:  coreinfo.PRJ_NAME,
		Type:     reflect.TypeOf(mcls),
	}
	coreutil.StructUtil.AddEntity(m)
}
